package com.matt.controller.web.course;


import com.starinside.wp.foundation.model.StatusResponse;
import com.tuo51.foudation.utils.export.HealthReportUtil;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.web.bind.annotation.RequestMethod.POST;


@RestController
@RequestMapping("/eapi/bmi")
@Api(value = "/eapi/bmi", tags = "测评 - 健康相关")
public class EvaluateHealthyController {

    @RequestMapping(value = "/info", method = POST)
    public StatusResponse bmiInfo(@RequestParam(name = "name", required = false) String name,
                                  @RequestParam(name = "gender", required = true) Integer gender,
                                  @RequestParam(name = "birthday", required = false) String birthday,
                                  @RequestParam(name = "weight", required = false) String weight,
                                  @RequestParam(name = "height", required = false) String height
                                         ){


        return StatusResponse.success(HealthReportUtil.bmiInfo(name, gender, birthday, weight, height));
    }

}
